package com.fhz.core_lib.mvvm;

import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import androidx.lifecycle.ViewModel;

/**
 * 时间:11/14/21
 *
 * @author msfeng
 * 简述: MvvMActivity
 */
public abstract class BaseMVVMActivity<VM extends ViewModel,VDB extends ViewDataBinding> extends BaseActivity {
    protected VM viewModel;
    protected VDB binding;

    @Override
    protected void initVMandDataBind() {
        binding = DataBindingUtil.setContentView(this,getLayoutId());
//        binding.setLifecycleOwner(this);
        viewModel = createViewModel();
    }
    protected abstract VM createViewModel();
    protected abstract int getLayoutId();

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }
}
